<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script>
      /**
       * @param {number[][]} matrix
       * @return {void} Do not return anything, modify matrix in-place instead.
       */
      var setZeroes = function(matrix) {
        let imap = {}
        let jmap = {}
        matrix.forEach((item,i)=>{
          item.forEach((col,j)=>{
            if(col===0) {
              imap[i] = true
              jmap[j] = true;
            }
          })
        })
        matrix.forEach((item,i)=>{
          item.forEach((col,j)=>{
            if(imap[i] || jmap[j]) {
              item[j] = 0
            }
          })
        })
        return matrix
      };
      let arr= [[1,1,1],[1,0,1],[1,1,1]]
      let ss = setZeroes(arr)
      console.log(ss)
    </script>
  </body>
</html>
